USE [Management]
GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_MessRead]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_MessRead]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service1]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service1]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service2]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service2]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service3]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service3]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service4]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service4]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service5]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service5]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service6]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service6]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service7]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service7]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service8]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service8]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service9]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service9]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service10]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service10]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service11]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service11]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service12]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service12]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service13]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service13]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service14]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service14]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service15]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service15]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service16]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service16]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service17]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service17]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service18]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service18]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service19]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service19]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service20]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service20]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service21]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service21]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service22]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service22]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service23]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service23]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service24]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service24]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service25]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service25]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service26]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service26]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service27]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service27]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service28]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service28]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service29]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service29]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Users_Service30]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Users] DROP CONSTRAINT [DF_Users_Service30]
END

GO

USE [Management]
GO

/****** Object:  Table [dbo].[Users]    Script Date: 04/19/2012 17:32:17 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Users]') AND type in (N'U'))
DROP TABLE [dbo].[Users]
GO

USE [Management]
GO

/****** Object:  Table [dbo].[Users]    Script Date: 04/19/2012 17:32:17 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[Users](
	[ID] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
	[uid] [int] NULL,
	[Logon] [varchar](50) NOT NULL,
	[FirstName] [varchar](50) NOT NULL,
	[LastName] [varchar](50) NOT NULL,
	[Sponsor] [int] NULL,
	[Enabled] [bit] NOT NULL,
	[Message] [varchar](1000) NULL,
	[DateMess] [datetime] NULL,
	[MessRead] [bit] NULL,
	[ID_Groups] [int] NULL,
	[MainAccessory] [varchar](32) NULL,
	[Accessory] [varchar](32) NULL,
	[Firms] [bigint] NULL,
	[Pass] [varchar](20) NULL,
	[Service1] [bit] NULL,
	[Service2] [bit] NULL,
	[Service3] [bit] NULL,
	[Service4] [bit] NULL,
	[Service5] [bit] NULL,
	[Service6] [bit] NULL,
	[Service7] [bit] NULL,
	[Service8] [bit] NULL,
	[Service9] [bit] NULL,
	[Service10] [bit] NULL,
	[Service11] [bit] NULL,
	[Service12] [bit] NULL,
	[Service13] [bit] NULL,
	[Service14] [bit] NULL,
	[Service15] [bit] NULL,
	[Service16] [bit] NULL,
	[Service17] [bit] NULL,
	[Service18] [bit] NULL,
	[Service19] [bit] NULL,
	[Service20] [bit] NULL,
	[Service21] [bit] NULL,
	[Service22] [bit] NULL,
	[Service23] [bit] NULL,
	[Service24] [bit] NULL,
	[Service25] [bit] NULL,
	[Service26] [bit] NULL,
	[Service27] [bit] NULL,
	[Service28] [bit] NULL,
	[Service29] [bit] NULL,
	[Service30] [bit] NULL,
 CONSTRAINT [PK_Service] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_MessRead]  DEFAULT ((0)) FOR [MessRead]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service1]  DEFAULT ((0)) FOR [Service1]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service2]  DEFAULT ((0)) FOR [Service2]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service3]  DEFAULT ((0)) FOR [Service3]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service4]  DEFAULT ((0)) FOR [Service4]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service5]  DEFAULT ((0)) FOR [Service5]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service6]  DEFAULT ((0)) FOR [Service6]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service7]  DEFAULT ((0)) FOR [Service7]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service8]  DEFAULT ((0)) FOR [Service8]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service9]  DEFAULT ((0)) FOR [Service9]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service10]  DEFAULT ((0)) FOR [Service10]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service11]  DEFAULT ((0)) FOR [Service11]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service12]  DEFAULT ((0)) FOR [Service12]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service13]  DEFAULT ((0)) FOR [Service13]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service14]  DEFAULT ((0)) FOR [Service14]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service15]  DEFAULT ((0)) FOR [Service15]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service16]  DEFAULT ((0)) FOR [Service16]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service17]  DEFAULT ((0)) FOR [Service17]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service18]  DEFAULT ((0)) FOR [Service18]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service19]  DEFAULT ((0)) FOR [Service19]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service20]  DEFAULT ((0)) FOR [Service20]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service21]  DEFAULT ((0)) FOR [Service21]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service22]  DEFAULT ((0)) FOR [Service22]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service23]  DEFAULT ((0)) FOR [Service23]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service24]  DEFAULT ((0)) FOR [Service24]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service25]  DEFAULT ((0)) FOR [Service25]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service26]  DEFAULT ((0)) FOR [Service26]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service27]  DEFAULT ((0)) FOR [Service27]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service28]  DEFAULT ((0)) FOR [Service28]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service29]  DEFAULT ((0)) FOR [Service29]
GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_Users_Service30]  DEFAULT ((0)) FOR [Service30]
GO

